package helloworld;

import jade.core.Agent;
import jade.core.behaviours.TickerBehaviour;

public class Hello extends Agent {
	IndividualBehaviour indBeh = new IndividualBehaviour();
	
	protected void setup(){
	  System.out.println("Hello World. ");
	  System.out.println("My name is "+ getLocalName());
	  
//	  // zeitticker (im 1000ms abstand wird "hello world" von Agend Hello (this) geschrieben)
//	  addBehaviour(new TickerBehaviour(this, 1000){
//			@Override
//			protected void onTick() {
//				println("Hello World!");
//			}
//		});
//
//	}
	  //eigene behaviour nutzen
	  indBeh.action(2);
	  
	}
	
	//abschiedsfloskel
	protected void takeDown() {
		this.println("Goodbye!");
	}
	
	private void println(String msg){
		System.out.println(getLocalName() + ": " + msg);
	}

	public Hello() {
	   System.out.println("Constructor called");
	}
}
